package com.glp.work.flow.handler.flowable.factory;

import org.flowable.bpmn.model.Activity;
import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior;
import org.flowable.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior;
import org.flowable.engine.impl.bpmn.parser.factory.DefaultActivityBehaviorFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import com.glp.work.flow.handler.flowable.ExtMultiInstanceUserTaskActivityBehavior;

/** 
*
* @author  pengjia 
* @version 2020年8月7日 下午2:09:24 
*/
@Component
public class ExtActivityBehaviorFactory extends DefaultActivityBehaviorFactory {
	
	@Autowired
	private ApplicationContext applicationContext;


	@Override
	public ParallelMultiInstanceBehavior createParallelMultiInstanceBehavior(Activity activity,
			AbstractBpmnActivityBehavior innerActivityBehavior) {
		ExtMultiInstanceUserTaskActivityBehavior behavior =  new ExtMultiInstanceUserTaskActivityBehavior(activity, innerActivityBehavior);
		behavior.setApplicationContext(applicationContext);
		return behavior;
	}

}
